#define  _CRT_SECURE_NO_WARNINGS 1
double fact(int n)
{
    if(n==1||n==0)
    return 1;
    else
    {
        fact(n-1)*n;
    }
    return he;
}
double factsum(int n)
{
    double sum = 0;
    for (int i = 1; i <= n; i++)
    {
        sum = sum + fact(i);
    }
    if (n == 0)
        return 0;
    return sum;
}

int main()
{
    int n;

    scanf("%d", &n);
    printf("fact(%d) = %.0f\n", n, fact(n));
    printf("sum = %.0f\n", factsum(n));

    return 0;
}
